package edu.bu.cs673.superkids123.parents.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name="sounds")
public class Sound {
	
	/**
	 * @author Abdelghani Bhalla
	 */
	@Id @GeneratedValue
	@Column(name="SoundID")
	private int id;
	
	@Column(name="SoundName")
	private String name;
	
	@Column(name="SoundFileName")
	private String fileName;
	
	@OneToMany(mappedBy="sound", fetch=FetchType.EAGER)
	private Set<SystemTheme> systemThemes = new HashSet<SystemTheme>();
	
	@OneToMany(mappedBy="sound")
	private Set<Number> numbers = new HashSet<Number>();
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public Set<SystemTheme> getSystemThemes() {
		return systemThemes;
	}
	public void setSystemThemes(Set<SystemTheme> systemThemes) {
		this.systemThemes = systemThemes;
	}
	public Set<Number> getNumbers() {
		return numbers;
	}
	public void setNumbers(Set<Number> numbers) {
		this.numbers = numbers;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public Sound(String name, String fileName)
	{
		this.name = name;
		this.fileName = fileName;
	}
	public void addNumber(Number n)
	{
		n.setSound(this);
		numbers.add(n);
	}
	public void addTheme(SystemTheme t)
	{
		t.setSound(this);
		systemThemes.add(t);
	}
	public Sound()
	{
		
	}
}
